var express = require('express');
var router = express.Router();

/* GET home page. */
/*
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});
*/

router.get('/test', function(req, res, next) {
	/* Get method test to get request parameter from client 
	 * http://127.0.0.1:3000/test?a=a&b=b
	 * The parameter will be parsed into req.query object
	 */
	/*
	var content = {"title":"","content":""};
	content.title = "Title";
	content.content = "Content";
	res.send(content);
	*/
	console.log(req.query);

});
router.post('/', function(req, res, next) {
	/* 
	 * Post method test to get request parameter from client 
	 * http://127.0.0.1:3000/
	 * {"title":"Title client"}
	 * The parameter will be parsed into req.body object
	 */
	/*
	var content = {"title":"","content":""};
	content.title = "Title";
	content.content = "Content";
	res.send(content);
	*/
	console.log(req.body);

});
module.exports = router;
